From: Steve Frécinaux Date: Fri, 16 Oct 2009 23:37:42 +0000 (+0200) Subject: [StThemeNode] round padding values intead of truncating them. X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10722 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5b769138b6a628e6cf4d8b6a6501ff3356721c32;p=gnome-shell.git [StThemeNode] round padding values intead of truncating them. This way, 49.9999 will end up as 50 instead of 49. https://bugzilla.gnome.org/show_bug.cgi?id=598651 --- diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c index d0e913555..40c478852 100644 --- a/src/st/st-theme-node.c +++ b/src/st/st-theme-node.c @@ -992,18 +992,22 @@ do_padding_property_term (StThemeNode *node, gboolean bottom) { gdouble value; + int int_value; if (get_length_from_term (node, term, FALSE, &value) != VALUE_FOUND) return; + /* Round the value */ + int_value = (int) (0.5 + value); + if (left) - node->padding[ST_SIDE_LEFT] = value; + node->padding[ST_SIDE_LEFT] = int_value; if (right) - node->padding[ST_SIDE_RIGHT] = value; + node->padding[ST_SIDE_RIGHT] = int_value; if (top) - node->padding[ST_SIDE_TOP] = value; + node->padding[ST_SIDE_TOP] = int_value; if (bottom) - node->padding[ST_SIDE_BOTTOM] = value; + node->padding[ST_SIDE_BOTTOM] = int_value; } static void